Skip to content

[BT][Test] Implement BT_SCAN_PAIR test with pairing retries, whitelist, and expect automation #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smuppand
Copy link
Contributor

This PR introduces a fully modular and Bluetooth scan and pairing test named BT_SCAN_PAIR for embedded Linux platforms using BlueZ. Key features include:

  • Modular structure with helper functions in functestlib.sh

  • Supports device identification via arguments, environment, or bt_device_list.txt

  • Optional whitelist filtering for MAC address or device name

  • Automatic retries for pairing in case of busy/in-progress errors

  • Expect-based automation for interactive pairing via bluetoothctl

  • Comprehensive cleanup using trap, ensures unpairing and resource cleanup after test (PASS/FAIL/SKIP)

  • Logs captured: scan.log, pair.log, and summary for debugging

@smuppand smuppand requested review from mwasilew and vnarapar June 24, 2025 16:50
- Renamed existing Bluetooth validation script to bt_on_off for clarity
- Added new BT_SCAN_PAIR test:
  - Supports dynamic BT device name input
  - Uses bluetoothctl and expect for pairing flow
  - Includes retry logic for hci0 up, scan, and pairing steps
  - Performs full scan-pair-cleanup lifecycle
  - Logs all intermediate steps for better CI debugging
  - Compatible with POSIX and ShellCheck guidelines

Resolves issues in earlier pairing logic and supports robust CI execution with dynamic device handling.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant